/****************************************************************************/
/* File: scs-error.h                                                        */
/* Desc: Specification file for the core error codes                        */
/* Created: 2014-11-10                                                      */
/* Revised: 2014-11-12                                                      */
/* Authors: Sterling P. de Mille                                            */
/****************************************************************************/

// include once
#ifndef _SCS_ERROR_H_
#define _SCS_ERROR_H_

// core data types
#include "scs-types.h"

// C string support
#include <string.h>
// I/O support
#include <iostream>

typedef SCSint32u SCSerror;

// core error codes
enum SCSerrorcodes
{
	SCS_ERROR_NONE								= 0x00000000,

	// type
	SCS_ERROR_TYPES								= 0x01000000,
	SCS_ERROR_CLOCK								= 0x02000000,
	SCS_ERROR_APPLICATION						= 0x03000000,
	SCS_ERROR_VIDEO								= 0x04000000,
	SCS_ERROR_INPUT								= 0x05000000,
	SCS_ERROR_AUDIO								= 0x06000000,
	SCS_ERROR_NETWORK							= 0x07000000,
	SCS_ERROR_MATH								= 0x08000000,
	SCS_ERROR_PHYSICS							= 0x09000000,

	// method
	SCS_ERROR_SET								= 0x00010000,
	SCS_ERROR_GET								= 0x00020000,
	SCS_ERROR_CREATE							= 0x00030000,
	SCS_ERROR_DESTROY							= 0x00040000,
	SCS_ERROR_LOAD								= 0x00050000,
	SCS_ERROR_SAVE								= 0x00060000,
	SCS_ERROR_INIT								= 0x00070000,
	SCS_ERROR_BEGIN								= 0x00080000,
	SCS_ERROR_END								= 0x00090000,
	SCS_ERROR_DRAW								= 0x000a0000,
	SCS_ERROR_PLAY								= 0x000b0000,
	SCS_ERROR_STOP								= 0x000c0000,
	SCS_ERROR_OPEN								= 0x000d0000,
	SCS_ERROR_CLOSE								= 0x000e0000,

	// item
	SCS_ERROR_MODE								= 0x00000100,
	SCS_ERROR_FLAG								= 0x00000200,
	SCS_ERROR_PRIMITIVE							= 0x00000300,
	SCS_ERROR_IMAGE								= 0x00000400,
	SCS_ERROR_SOUND								= 0x00000500,
	SCS_ERROR_MUSIC								= 0x00000600,
	SCS_ERROR_KEYBOARD							= 0x00000700,
	SCS_ERROR_MOUSE								= 0x00000800,
	SCS_ERROR_CONTROLLER						= 0x00000900,
	SCS_ERROR_DEVICE							= 0x00000a00,
	SCS_ERROR_DISPLAY							= 0x00000b00,

	// message
	SCS_ERROR_NULL								= 0x00000001,
	SCS_ERROR_NOTSUPPORTED						= 0x00000002,
	SCS_ERROR_INVALID							= 0x00000003,

	SCS_ERROR_FORCE32							= 0xFFFFFFFF
};

SCSerror scsErrorType (SCSint32u iError);
SCSerror scsErrorMethod (SCSint32u iError);
SCSerror scsErrorItem (SCSint32u iError);
SCSerror scsErrorMessage (SCSint32u iError);

SCSstring scsErrorTypeString (SCSerror iError);
SCSstring scsErrorMethodString (SCSerror iError);
SCSstring scsErrorItemString (SCSerror iError);
SCSstring scsErrorMessageString (SCSerror iError);
SCSstring scsErrorString (SCSerror iError);

#endif // _SCS_ERROR_H_
